﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Map_Creator.MainForm.Controls.MenuStrips.GenericMenuItems
{
    public partial class RemoveMenuItem : ToolStripMenuItem
    {
        public RemoveMenuItem()
        {
            InitializeComponent();
        }

        public RemoveMenuItem(IContainer container)
        {
            container.Add(this);

            InitializeComponent();
        }

        private void OnClick(object sender, EventArgs e)
        {
            var node = MapTreeView.Instance.SelectedNode as ExtendedTreeNode;
            if (node == null) return;

            node.Obj.Delete();
        }
    }
}
